******************
**** Table B4 ****
****************** 

use "$data/telephone_surveydata_ready" , clear

local controls teamdummy* firststickerdummy* preratiow1 lastdebt_demeanedw1 prepaymentsmadedummy*  
local addcontrols i.collectiv i.pc i.highvisible



log using "$output/table b4", replace

** Randomization Strata **
reg q8 above##i.treatmentidentitynew if treatmentall!=0, vce(cluster dayteam)

*inverse probability weights
oprobit q8 above##i.treatmentidentitynew if treatmentall!=0 [pweight = (1/pre_inv_insurveysample) ] , vce(cluster dayteam)

*additional controls
oprobit q8 above##i.treatmentidentitynew `controls' `addcontrols' if treatmentall!=0 , vce(cluster dayteam)

*Ols additional controls
reg idindex above##i.treatmentidentitynew `controls' `addcontrols' if treatmentall!=0 , vce(cluster dayteam)

log close
